/*
day294_2
2020.6.17
*/
#include<iostream>
#include<vector>
#include<cmath>
using namespace std;

class Solution {
public:
    int minTimeToVisitAllPoints(vector<vector<int>>& points) {
    	int res=0;
		for(int i=0;i<points.size()-1;++i)
		{
			res+=minTimeBetweenTwoPoints(points[i],points[i+1]);
		}
		return res;
    }
    
    int minTimeBetweenTwoPoints(const vector<int> &point1,const vector<int> &point2)
    {
    	int dif_x=abs(point1[0]-point2[0]);
    	int dif_y=abs(point1[1]-point2[1]);
    	
    	return min(dif_x,dif_y)+abs(dif_x-dif_y);
	}
};

int main()
{
	return 0;
}
